1. Field of the Invention
The present invention relates to a method, system, and program for method, system, and program for handling interrupt requests.
2. Description of the Related Art
In many operating systems, such as Microsoft Windows(copyright), Linux(copyright), Unix(copyright), etc. multiple devices may communicate over a bus interface with the operating system interrupt service routine (ISR) using a single interrupt line. (Microsoft and Windows are registered trademarks of Microsoft Corporation, Linux is a registered trademark of Linus Torvalds, UNIX is a registered trademark of The Open Group). One of multiple devices using an interrupt line, would assert an interrupt on the bus to the interrupt line assigned to that device to request or transmit data to the operating system. The operating system would further execute various device driver programs that provide a software interface between the operating system and the device. A device driver includes device specific commands to communicate with and control one attached device. Upon receiving a device interrupt, the operating system ISR would poll each device driver interrupt service routine (ISR) running in the operating system to identify the device driver ISR associated with the device that asserted the interrupt.
In response to receiving the polling request from the operating system ISR asking the device driver ISR whether the interrupt is from the device driver""s device, the device driver ISR communicates with the associated device and reads an interrupt status register in the device to determine whether the driver""s device sent the interrupt request.
In the Microsoft(copyright) Windows(copyright) operating system (Microsoft and Windows are registered trademarks of Microsoft Corporation), if the device status registers indicate that the device did send an interrupt request, then the device driver ISR responds to the operating system ISR by claiming the interrupt and requesting a deferred procedure call (DPC) to use to process the device request that is the subject of the interrupt request. If a device driver ISR responds that the interrupt is not from the device associated with the driver, then the operating system ISR determines a next device driver in a chain of device drivers to poll and sends the request to the next device driver ISR in the chain. The operating system ISR continues polling device driver ISRs in the list until one device driver ISR claims the interrupt and requests resources to run the DPC. In non-Windows operating systems, such as Linux or Unix, the interrupt device driver would just perform the interrupt related work; no DPC is involved.
The device driver ISRs will set the value for two flags when called by the operating system ISR. One flag indicates whether the device driver ISR claims the interrupt and another flag indicates whether the device driver is requesting a DPC to handle the interrupt. In the prior art, the device driver ISR will set both flags to either xe2x80x9conxe2x80x9d or xe2x80x9coffxe2x80x9d. Thus, if the device driver ISR determines that the interrupt request is from the driver""s device, then the device driver sets the flag to indicate claiming the interrupt and sets the DPC flag to indicate a request for a DPC resource to process interrupt related work. If the device driver ISR determines that the interrupt is not from the driver""s device, then the device driver sets the flag to indicate that it is not claiming the interrupt and sets the DPC flag to indicate no request for a DPC resource to process interrupt related work.
After one device driver ISR claims the interrupt, the operating system ISR switches context and terminates interrupt service handling. Upon receiving a subsequent interrupt, the operating system ISR will have to switch context to interrupt service handling to locate the device driver to handle the interrupt request. This process to switch context between interrupt service handling and other states requires significant processing resources and time. As device bandwidth increases and as more devices are attached to a computer system, the number of interrupts generated has likewise increased significantly. This increase in the number of interrupts places increased burdens on the operating system because the operating system must repeatedly context switch in and out of interrupt service handling in response to each interrupt request.
For these reasons, there is a need in the art to provide improved techniques for handling device interrupt requests.